package topics;

/*
 * This class is a main topic.
 */

/**
 *
 * @author link3988
 */
import java.util.ArrayList;
public class MainTopic  extends Topic{

    private String topic = "";
    ArrayList<SubTopic> subtopics;
    public MainTopic(String tp)
    {
        setTopic(tp);
        subtopics = new ArrayList();
    }

    /**
     *
     * @return returns this microtopic.
     */
    public String getTopic()
    {
        return super.getTopic();
    }

    /**
     * adds the subtopic to this main topic
     * @param sbtp
     */
    public void addSubTopic(SubTopic sbtp)
    {
        subtopics.add(sbtp);
    }

    /**
     *
     * @return the size of the subtopics of this main topic.
     */
    public int subSize()
    {
        return subtopics.size();
    }

    /**
     * returns the subtopic at the specified index.
     * @param index
     * @return
     */
    public SubTopic getSubTopic(int index)
    {
        return subtopics.get(index);
    }

    /**
     * apprends the addition to this main topic.
     * @param addition
     */
    public void addToTopic(String addition)
    {
        super.addToTopic(addition);
    }

    /**
     * changes the topic to this new topic.
     * @param newTopic
     */
    public void setTopic(String newTopic)
    {
        super.setTopic(newTopic);
    }

}
